<?php
$line= $registers[0]['Register'];
$this->CSV->addRow(array_keys($line));
foreach ($registers as $key => $row)
{
    $row['Register']['No.'] = $key+1;
    $this->CSV->addRow($row['Register']);
}
 $filename='register_' . date('Ymd');
 echo  $this->CSV->render($filename);
